local skel = fk.CreateSkill {
  name = "lb_zero__mengyao_high_dulahan",
  max_branches_use_time = {
    ["from"] = {
      [Player.HistoryTurn] = 1
    },
    ["to"] = {
      [Player.HistoryTurn] = 1
    },
  }
}

Fk:loadTranslationTable {
  ["lb_zero__mengyao_high_dulahan"] = "恶名·杜拉罕",
  [":lb_zero__mengyao_high_dulahan"] = "每回合各限一次，当你成为【杀】的目标后，你可令此【杀】使用者选择弃置其攻击范围数张牌或令此【杀】无效。当你使用【杀】指定唯一目标后，你可令其弃置你攻击范围数张牌，否则此【杀】伤害+1且不可被响应。",

  ["#lb_zero__mengyao_high_dulahan-from"] = "恶名·杜拉罕：你可令 %src 选择弃置 %arg 张牌或令 %arg2 伤害+1且不可被响应",
  ["#lb_zero__mengyao_high_dulahan-to"] = "恶名·杜拉罕：你可令 %src 选择弃置 %arg 张牌或令 %arg2 无效",

  ["#lb_zero__mengyao_high_dulahan-from-dis"] = "恶名·杜拉罕：请弃置 %arg 张牌，否则 %arg2 伤害+1且不可被响应",
  ["#lb_zero__mengyao_high_dulahan-to-dis"] = "恶名·杜拉罕：请弃置 %arg 张牌，否则 %arg2 无效",


  ["$lb_zero__mengyao_high_dulahan1"] = "",
  ["$lb_zero__mengyao_high_dulahan2"] = "",
  ["$lb_zero__mengyao_high_dulahan3"] = "",
}

skel:addEffect(fk.TargetSpecified,{
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
        return player:hasSkill(skel.name) and target == player and data:isOnlyTarget(data.to) and data.card.trueName == "slash"
        and skel:withinBranchTimesLimit(player, "from", Player.HistoryTurn) and data.to and data.to:isAlive()
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = skel.name, prompt = "#lb_zero__mengyao_high_dulahan-from:".. data.to.id.."::" .. player:getAttackRange() .. ":" .. data.card:toLogString() })
  end,
  on_use = function(self, event, target, player, data)
    player:addSkillBranchUseHistory(skel.name, "from" )
    local num = player:getAttackRange()
    if #player.room:askToDiscard(data.to, {
      min_num = num,
      max_num = num,
      skill_name = skel.name,
      include_equip = true,
      prompt = "#lb_zero__mengyao_high_dulahan-from-dis:::" .. num .. ":" .. data.card:toLogString(),
    }) < num then
      data.use.additionalDamage = (data.use.additionalDamage or 0) + 1
      data.use.disresponsiveList = player.room.players
    end
  end,
})

skel:addEffect(fk.TargetConfirmed,{
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
        return player:hasSkill(skel.name) and target == player and data.from and data.from:isAlive()
        and skel:withinBranchTimesLimit(player, "to", Player.HistoryTurn) and data.card.trueName == "slash"
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = skel.name, prompt = "#lb_zero__mengyao_high_dulahan-to:".. data.from.id.."::" .. data.from:getAttackRange() .. ":" .. data.card:toLogString() })
  end,
  on_use = function(self, event, target, player, data)
    player:addSkillBranchUseHistory(skel.name, "to" )
    local num = data.from:getAttackRange()
    if #player.room:askToDiscard(data.from, {
      min_num = num,
      max_num = num,
      skill_name = skel.name,
      include_equip = true,
      prompt = "#lb_zero__mengyao_high_dulahan-to-dis:::" .. num .. ":" .. data.card:toLogString(),
    }) < num then
      data:setNullified(player.room.players)
    end
  end,
})

return skel